
#include "openssl/rand.h"
#include <dirent.h>
#include <dlfcn.h>
#include <string.h>
#include "ssl_locl.h"
#include "eap.h"

BIO *eap_err = NULL;

int EAP_finalize_eap_message(SSL *s,const unsigned char *eap_msg, const unsigned int eap_msg_len)
{
    unsigned char *p;
    if(!s) goto err;    
    if(!BUF_MEM_grow(s->init_buf,eap_msg_len + 4))
        goto err;
    s->init_num = eap_msg_len + 4;
    p = s->init_buf->data;

    /*handshake header*/
    *(p++) = SSL3_MT_EAP;
    l2n3(eap_msg_len, p);
    memcpy(p,eap_msg,eap_msg_len);
    s->init_off = 0;
    return(1);
err:
    return(0);
}
